package test;

import util.JavaUtil1;

import java.sql.ResultSet;
import java.sql.SQLException;

public class JDBCDemo {
    public static void main(String[] args) throws SQLException {
        String sql="select st.sno,st.sname,st.sage,sum(grade) as sum from sc s,student st where s.sno=st.sno\n" +
                "                group by s.sno having sum(grade)>?";
        Object[] o={200};
      ResultSet rs=JavaUtil1.excutequery(sql,o);
        while (rs.next()){
            System.out.println("姓名为"+rs.getString("sname")+"\t总成绩"+rs.getInt("sum"));

        }
        JavaUtil1.close();

    }

}
